package com.spsy.pay.controller;

import com.spsy.common.core.domain.R;
import com.spsy.pay.service.PayOptsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: liuzhiping
 * @date: 2025/1/9 14:46
 **/
@RestController
@RequestMapping("/pay")
@Slf4j
public class PayOptsController {

    @Autowired
    private PayOptsService payOptsService;

    @RequestMapping("/exec")
    public R pay(@RequestParam String orderId){
        log.info("控制层 pay orderId:{}",orderId);
        return this.payOptsService.pay(orderId);
    }

    @RequestMapping("/view")
    public R view(@RequestParam String orderId) throws Exception{
        log.info("控制层 view orderId:{}",orderId);
        return this.payOptsService.view(orderId);
    }
}
